<template>
	<view class="My">
		<view class="MyHead">
			<image src="../../static/MyBj.png" class="MyHeadImgBj" mode=""></image>
			<!-- <view style="float: right;font-size: 28rpx;font-weight: 500;margin-right: 41rpx;z-index: 9;position: absolute;right: 0;" @click="MyClick(11)">
				设置
			</view> -->
			<view class="MyHeadjS">
				<view style="display: inline-block;margin-right: 31rpx;">
					<image src="../../static/lb.png" style="width: 115rpx;height: 115rpx;border-radius: 50%;" mode=""></image>
				</view>
				<view style="display: inline-block;position: relative;top: -10rpx;">
					<view style="font-size: 40rpx;margin-bottom: 16rpx;">
						<!-- 156****5205 -->
						{{phone}}
					</view>
					<view class="">
						<image src="../../static/jb.png" style="width: 32rpx;height: 32rpx;position: relative;top: 6rpx;margin-right: 10rpx;" mode=""></image>
						<text>我的金币</text>
						<text style="padding: 0 10rpx;color: #DFAD7B;">{{InfoData.gold}}</text>
						<text>去赚币</text>
					</view>
				</view>
				<view class="MyHeadjSBottom">
					<view class="MyHeadjSBottomDiv" @click="MyClick(1)">
						<image src="../../static/wyhk.png" style="width: 57rpx;height: 57rpx;margin-right: 15rpx;" mode=""></image>
						<text style="font-size: 28rpx;font-weight: 800;color: #717171;position: relative;top: -19rpx;">我要还款</text>
					</view>
					<view class="MyHeadjSBottomDiv" @click="MyClick(2)">
						<image src="../../static/dkjl.png" style="width: 49rpx;height: 57rpx;margin-right: 15rpx;" mode=""></image>
						<text style="font-size: 28rpx;font-weight: 800;color: #717171;position: relative;top: -19rpx;">贷款记录</text>
					</view>
				</view>
			</view>
		</view>
		<view class="MyQuota">
			<view style="font-weight: 800;color: #CBB794;margin-bottom: 55rpx;">
				<image src="../../static/MyQuotaImage.png" style="width: 47rpx;height: 24rpx;" mode=""></image>
				<text style="font-size: 32rpx;margin: 0 10rpx;">优选贷</text>
				<text style="font-size: 24rpx;">人人都能借到钱，超3000万人已下款</text>
			</view>
			<view style="color: #1B1D21;font-size: 24rpx;font-weight: 800;">
				最高可用额度（元）
			</view>
			<view class="">
				<text style="font-size: 72rpx;font-weight: 800;">200000</text>
				<text @click="MyClick(12)" class="MyQuotaRight">领取我的额度</text>
			</view>
			<view class="">
				<image src="../../static/bqwjx.png" style="width: 24rpx;height: 28rpx;margin-right: 10rpx;position: relative;top: 5rpx;" mode=""></image>
				<span style="font-size: 24rpx;">借1千元日息低至3毛 | 快至1分钟放款</span>
			</view>
		</view>
		<view class="MyList">
			<view class="MyListView" @click="MyClick(3)">
				<span>信用档案</span>
				<image src="../../static/Right.png" style="width: 18rpx;height: 33rpx;float: right;position: relative;top: 40rpx;" mode=""></image>
			</view>
			<view class="MyListView" @click="MyClick(4)">
				<span>我的收藏</span>
				<image src="../../static/Right.png" style="width: 18rpx;height: 33rpx;float: right;position: relative;top: 40rpx;" mode=""></image>
			</view>
			<view class="MyListView" @click="MyClick(5)">
				<span>浏览记录</span>
				<image src="../../static/Right.png" style="width: 18rpx;height: 33rpx;float: right;position: relative;top: 40rpx;" mode=""></image>
			</view>
			<view class="MyListView" @click="MyClick(6)">
				<span>我的零钱</span>
				<image src="../../static/Right.png" style="width: 18rpx;height: 33rpx;float: right;position: relative;top: 40rpx;" mode=""></image>
				<span style="float: right;position: relative;color: #878787;margin-right: 20rpx;">0.00</span>
			</view>
			<view class="MyListView" @click="MyClick(7)">
				<span>优惠券</span>
				<image src="../../static/Right.png" style="width: 18rpx;height: 33rpx;float: right;position: relative;top: 40rpx;" mode=""></image>
				<span style="float: right;position: relative;color: #878787;margin-right: 20rpx;">0 张</span>
			</view>
			<view class="MyListView" @click="MyClick(8)">
				<span>客服中心</span>
				<image src="../../static/Right.png" style="width: 18rpx;height: 33rpx;float: right;position: relative;top: 40rpx;" mode=""></image>
			</view>
		</view>
		
		<view class="MyList">
			<!-- <view class="MyListView" @click="MyClick(10)">
				<span>关于我们</span>
				<image src="../../static/Right.png" style="width: 18rpx;height: 33rpx;float: right;position: relative;top: 40rpx;" mode=""></image>
			</view> -->
			<view class="MyListView" @click="MyClick(11)">
				<span>设置</span>
				<image src="../../static/Right.png" style="width: 18rpx;height: 33rpx;float: right;position: relative;top: 40rpx;" mode=""></image>
			</view>
		</view>
		<view class="indexBottom">
			融 多 多 贷 款 · 您 的 贷 款 专 家
		</view>
	</view>
</template>

<script>
	import {VUE_API_URL} from "@/components/pulugins/index"
	export default {
		components: {},
		data() {
			return {
				InfoData:'',
				phone:0,
			}
		},
		onShow() { 
			this.UserIndex();
		},
		methods: {
			UserIndex(){
				var that = this;
				uni.request({
				    url: VUE_API_URL + 'user/info', 
					method:'POST',
				    data: {}, 
				    header: {
				        'Authori-zation': 'Bearer ' + uni.getStorageSync('token') //自定义请求头信息
				    },
				    success: (res) => {
						// console.log(res.data.data.phone);
						that.InfoData = res.data.data;
						var tel = String(that.InfoData.phone);
						var dh=tel.substr(0,3)+"******"+tel.substr(8);
						that.phone = dh;
					},
				})
			},
			MyClick(index){
				if(index == 1){
					uni.navigateTo({		//立即还款
					    url: '../second/repayment'
					});
				}else if(index == 2){		
					uni.navigateTo({		//贷款记录
					    url: '../second/LoanRecords'
					});
				}else if(index == 3){
					uni.navigateTo({		//信用档案
					    url: '../second/CreditFile'
					});
				}else if(index == 4){
					uni.navigateTo({       //我的收藏
						url:'../second/MyCollection'
					})
				}else if(index == 5){
					uni.navigateTo({       //浏览记录
						url:'../second/BrowsingHistory'
					})
				}else if(index == 6){
					uni.navigateTo({       //我的零钱
						url:'../second/MySmallChange'
					})
				}else if(index == 7){
					uni.navigateTo({       //优惠券
						url:'../second/coupon'
					})
				}else if(index == 8){
					uni.navigateTo({       //客服中心
						url:'../second/kefuCenter'
					})
				}else if(index == 9){
					
				}else if(index == 10){
					uni.navigateTo({       //关于我们
						url:'../second/aboutUs'
					})
				}else if(index == 11){
					uni.navigateTo({		//设置
					    url: '../second/SetUp'
					});
				}else if(index == 12){
					uni.navigateTo({		//领取我的额度
						url: '../second/PreferredLoan'
					});
				}
			}
		}
	}
</script>

<style>
	.MyListView{
		width: 100%;
		height: 114rpx;
		padding: 0 50rpx;
		box-sizing: border-box;
		font-size: 32rpx;font-weight: 800;color: #434343;
		line-height: 114rpx;
	}
	.MyList{
		width: 100%;
		background: #FFFFFF;
		margin-top: 30rpx;
	}
	.MyQuotaRight{
		display: inline-block;
		width: 221rpx;
		height: 70rpx;
		line-height: 70rpx;
		font-size: 30rpx;
		font-weight: bold;
		color: #FFFFFF;
		background: linear-gradient(-84deg, #DFB993, #DFAD7B);
		border-radius: 50rpx;
		text-align: center;
		float: right;
		position: relative;
		top: 15rpx;
	}
	page{
		background: rgba(248,248,248);
	}
	.MyQuota{
		width: 100%;
		background: #FFFFFF;
		padding: 0 50rpx;
		box-sizing: border-box;
		min-height: 300rpx;
		margin-top: 80rpx;
	}
	.MyHeadjSBottom{
		margin-top: 80rpx;
	}
	.MyHeadjSBottomDiv{
		display: inline-block;
		height: 57rpx;
		width: 50%;
		text-align: center;
	}
	.MyHeadjS{
		font-size: 24rpx;
		padding: 0 45rpx;
		box-sizing: border-box;
		margin-top: 28rpx;
	}
	.MyHeadImgBj{
		width: 100%;
		height: 420rpx;
		position: absolute;
		top: 0;
		z-index: 0;
	}
	.MyHead{
		width: 100%;
		position: relative;
		font-family: PingFang SC;
		padding-top: 87rpx;
	}
</style>
